package com.dream.jump.entity

/**
 * A generic class that holds a value with its loading status.
 * @param <T>
 */
class Result<T>(
    private val code: Int,
    private val statusCode: Int,
    private val data: T,
    private val message: String
) {
    fun parseData(): T {
        if (data == null || code != 0) {
            throw Exception(message.ifEmpty { "error" })
        }
        return data
    }
}
